<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>数组添加删除</title>
	</head>
	<body>
		<script type="text/javascript">
		
			//push从后面添加
			var sort = ["儒家","墨家","鬼谷","道家"];
			console.log(sort);
			sort.push("阴阳家");
			console.log(sort);
			//pop从数组后面删除
			sort.pop();
			console.log(sort.pop());
			console.log(sort);
			//unshift从数组前面添加
			sort.unshift("农家");
			console.log(sort);
			//shift从前面删除
			sort.shift();
			console.log(sort.shift());
			console.log(sort);
		
		</script>
	</body>
</html>